//
//  UIBarButtonItem+Costom.swift
//  SinaWeiBo
//
//  Created by jiwang on 15/12/20.
//  Copyright © 2015年 jiwang. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    
    convenience init(imageName : String) {
        
        let leftBtn = UIButton(type: UIButtonType.Custom)
        leftBtn.setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        leftBtn.setImage(UIImage(named: "\(imageName)_highlighted"), forState: UIControlState.Highlighted)
        leftBtn.sizeToFit()
        
        self.init(customView:leftBtn)
    }
    
}